<?php
    echo $this->render("header.phtml");
    $flashMessenger = Zend_Controller_Action_HelperBroker::getStaticHelper('flashMessenger');
    $controllerName = Zend_Controller_Front::getInstance()->getRequest()->getControllerName();
    $actionName = Zend_Controller_Front::getInstance()->getRequest()->getActionName();

    //checking if scrollbar is to be used or not
    $_wrapperClass = '';

    if($actionName == 'login')
        $_wrapperClass = 'login-page';

    if($controllerName == 'myaccount')
        $_wrapperClass = 'myaccount-page';
    
//    $pages = array('brand::index');
//    if (in_array($controllerName . "::" . $actionName, $pages))
//    {
//        $_wrapperClass = 'diamond-background';
//    }
    //gcm($flashMessenger); die;
?>

<div id="middle" class="<?php echo $_wrapperClass; ?>">
    <?php
        if ($flashMessenger->hasMessages())
        {
            $message = $flashMessenger->getMessages();
            ?>

            <?php
            if (array_key_exists('success', $message[0]))
            {
                ?>
                <p class="bg-success flashmessenger">&nbsp;<?php echo $message[0]['success']; ?></p>
                <?php
            }
            else
            {
                ?>
                <p class="bg-danger flashmessenger">&nbsp;<?php echo $message[0]['error']; ?></p>
                <?php
            }
            ?>

            <script type="text/javascript">

                setTimeout(function() {
                    $('.flashmessenger').fadeOut('slow');
                }, 3000);

            </script>
            <?php
        }
    ?>
    <?php echo $this->layout()->content; ?>
</div>
<?php
    echo $this->render("footer.phtml");
?>